// 网易云音乐相关的 API 接口
import NeteaseCloudMusicApi from '@/utils/NeteaseCloudMusicApi'

// 按需导出歌单列表数据
export const getSongGroupListAPI = function () {
  return NeteaseCloudMusicApi.get('/personalized?limit=10')
}

// 按需导出热门歌单分类
export const getHotPlayListAPI = function () {
  return NeteaseCloudMusicApi.get('/playlist/hot')
}

// 按需导出歌单分类
export const getCatlistPlayListAPI = function () {
  return NeteaseCloudMusicApi.get('/playlist/catlist')
}

// 按需导出歌单（网友精选）
export const getTopPlayListAPI = function (cat, offset) {
  return NeteaseCloudMusicApi.get(`/top/playlist?cat=${cat}&offset=${offset}`)
}

// 按需导出精品歌单列表标签
export const getHighQualityPlayListTagsAPI = function () {
  return NeteaseCloudMusicApi.get('/playlist/highquality/tags')
}

// 按需导出精品歌单
export const getHighQualityPlayListAPI = function (cat, limit, before) {
  if (before) {
    return NeteaseCloudMusicApi.get(`/top/playlist/highquality?cat=${cat}&limit=${limit}&before=${before}`)
  } else {
    return NeteaseCloudMusicApi.get(`/top/playlist/highquality?cat=${cat}&limit=${limit}`)
  }
}
